package com.yang.entity;


import javax.persistence.*;

@Entity
@Table(name = "liver_relation")
public class RelationEntity {
    @Id
    @Column(name = "id")
    private long id;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "user_id")
    private UserEntity userId;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "room_id")
    private  RoomEntity roomId;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "order_form_id")
    private OrderFormEntity orderFormId;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "guest_id")
    private GuestEntity guestId;

    @Column(name = "status")
    private String status;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public UserEntity getUserId() {
        return userId;
    }

    public void setUserId(UserEntity userId) {
        this.userId = userId;
    }

    public RoomEntity getRoomId() {
        return roomId;
    }

    public void setRoomId(RoomEntity roomId) {
        this.roomId = roomId;
    }

    public OrderFormEntity getOrderFormId() {
        return orderFormId;
    }

    public void setOrderFormId(OrderFormEntity orderFormId) {
        this.orderFormId = orderFormId;
    }

    public GuestEntity getGuestId() {
        return guestId;
    }

    public void setGuestId(GuestEntity guestId) {
        this.guestId = guestId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "RelationEntity{" +
                "id=" + id +
                ", userId=" + userId +
                ", roomId=" + roomId +
                ", orderFormId=" + orderFormId +
                ", guestId=" + guestId +
                ", status='" + status + '\'' +
                '}';
    }
}
